package cn.topcodes.tcsf.cms.web.frontend;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by Unicorn on 2017/12/25.
 */
@Controller
@RequestMapping("cms")
public class CmsController {

    /**
     * 主页
     * @param model
     * @return
     */
    @RequestMapping(value = "index", method = RequestMethod.GET)
    public String index(Model model) {
        model.addAttribute("name", "Unicorn");
        return "index";
    }

    /**
     * 单页
     * @param model
     * @return
     */
    @RequestMapping(value = "page/{id}", method = RequestMethod.GET)
    public String page(Model model) {
        model.addAttribute("name", "Unicorn");
        return "index";
    }

    /**
     * 产品展示
     * @param model
     * @return
     */
    @RequestMapping(value = "production/{catalogId}", method = RequestMethod.GET)
    public String production(Model model) {

        return "product-show";
    }

    /**
     * 客户案例
     * @param model
     * @return
     */
    @RequestMapping(value = "case/{catalogId}", method = RequestMethod.GET)
    public String customerCase(Model model) {

        return "customer-case";
    }

    /**
     * 文章
     * @param model
     * @return
     */
    @RequestMapping(value = "article/{catalogId}", method = RequestMethod.GET)
    public String article(Model model) {

        return "news";
    }

    /**
     * 关于我们
     * @param model
     * @return
     */
    @RequestMapping(value = "about-us", method = RequestMethod.GET)
    public String aboutUs(Model model) {

        return "about-us";
    }

    /**
     * 招聘
     * @param model
     * @return
     */
    @RequestMapping(value = "recruitment", method = RequestMethod.GET)
    public String recruitment(Model model) {

        return "recruit";
    }
}
